<?php if(!$succ) { ?>

  <?php echo CHtml::beginForm('','post',array('enctype'=>'multipart/form-data')); ?>
  <?php echo CHtml::errorSummary($recipe); ?>
  <div>
    <h3>
        请选择图片
    </h3>
    <?php echo CHtml::activeFileField($recipe,'image',array('size'=>40)); ?>
  </div>
  支持jpg、gif、png格式的图片
  <div style="text-align: center; margin-top: 20px; font-size: 21px;" class="submit">
    <?php echo CHtml::submitButton('提交'); ?>
  <?php echo CHtml::linkButton('删除图片',array(
    'submit'=>array('deleteImage','id'=>$recipe->id),
    'confirm'=>"您确认要删除图片？",
  )); ?>
  </div>
  <?php echo CHtml::endForm(); ?>
<?php
} 
else {
    $imageUrl=UserImage::toUrl('recipe',$recipe->image,'big');
    echo CHtml::script("
        parent.setRecipeImage('$imageUrl');
        parent.$.fn.colorbox.close();
    ");
} 
?>